#include <QtGui/QApplication>
#include <QSharedMemory>
#include <QMessageBox>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QSharedMemory shared("465aa7dc-b000-49c2-bd58-7818aae0eab7");
    if( !shared.create( 512, QSharedMemory::ReadWrite) )
    {
        QMessageBox msgBox;
        msgBox.setText( QObject::tr("Can't start more than one instance of the application.") );
        msgBox.setIcon( QMessageBox::Critical );
        msgBox.exec();
        exit(0);
    }
    else
    {
        qDebug() << "Application started successfully.";
    }


    MainWindow w;
    return a.exec();
}
